package com.example.demo.es.vo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "employee")
@Data
public class Employee {

    @Id
    private Long id;

    @Field(type = FieldType.Keyword)
    private String name;

    private Integer age;

    private Integer sex;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String address;

    public Employee(Long id, String name, Integer age, Integer sex, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.address = address;
    }


}
